using System;

namespace SmartPeople.Framework.SecuritySpace
{
    /// <summary>
    /// Security User Interface
    /// </summary>
    public interface ISecurityUser
    {
        /// <summary>
        /// Full Name of User
        /// </summary>
        string FullName { get; set; }

        /// <summary>
        /// Description of User
        /// </summary>
        string Description { get; set; }


        /// <summary>
        /// Comment related to user.
        /// </summary>
        /// <value>The comment.</value>
        string Comment { get; set; }

        //set
        /// <summary>
        /// Gets the date and time when the user was added to the membership data store.
        /// </summary>
        /// <value>The date and time when the user was added to the membership data store.</value>
        DateTime CreationDate { get; set; }


        /// <summary>
        /// Gets or sets the e-mail address for the membership user.
        /// </summary>
        /// <value>The e-mail address for the membership user.</value>
        string Email { get; set; }


        /// <summary>
        /// Gets or sets whether the membership user can be authenticated.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is approved; otherwise, <c>false</c>.
        /// </value>
        bool IsApproved { get; set; }


        //set
        /// <summary>
        ///Gets a value indicating whether the membership user is locked out and unable to be validated.
        /// </summary>
        /// <value>
        /// true if the membership user is locked out and unable to be validated; otherwise,false.
        /// </value>
        bool IsLockedOut { get; set; }

        //set
        /// <summary>
        /// Gets whether the user is currently online.
        /// </summary>
        /// <value><c>true</c> if the user is online; otherwise, <c>false.</c></value>
        bool IsOnline { get; set; }


        /// <summary>
        /// Gets or sets the date and time when the membership user was last authenticated
        /// or accessed the application.
        /// </summary>
        /// <value>The date and time when the membership user was last authenticated or accessed the application.</value>
        DateTime LastActivityDate { get; set; }


        /// <summary>
        /// Gets the most recent date and time that the membership user was locked out.
        /// </summary>
        /// <value>A System.DateTime object that represents the most recent date and time that the membership user was locked out.</value>
        DateTime LastLockoutDate { get; set; }


        /// <summary>
        /// Gets or sets the date and time when the user was last authenticated.
        /// </summary>
        /// <value>The date and time when the user was last authenticated.</value>
        DateTime LastLoginDate { get; set; }


        //set
        /// <summary>
        /// Gets the date and time when the membership user's password was last updated.
        /// </summary>
        /// <value>The date and time when the membership user's password was last updated.</value>
        DateTime LastPasswordChangedDate { get; set; }


        //set
        /// <summary>
        /// Gets the password question for the membership user.
        /// </summary>
        /// <value>The password question for the membership user.</value>
        string PasswordQuestion { get; set; }


        //set
        /// <summary>
        ///Gets the name of the membership provider that stores and retrieves user information for the membership user.
        /// </summary>
        /// <value>The name of the membership provider that stores and retrieves user information for the membership user.</value>
        string ProviderName { get; set; }

        //set
        /// <summary>
        /// Gets the user identifier from the membership data source for the user.
        /// </summary>
        /// <value>The user identifier from the membership data source for the user.</value>
        object ProviderUserKey { get; set; }

        ///set
        /// <summary>
        /// Gets the logon name of the membership user.
        /// </summary>
        /// <value>The logon name of the membership user.</value>
        string UserName { get; set; }


        /// <summary>
        /// Updates the password for the membership user in the membership data store.
        /// </summary>
        /// <param name="oldPassword">The current password for the membership user.</param>
        /// <param name="newPassword"> The new password for the membership user.</param>
        /// <returns> true if the update was successful; otherwise, false.</returns>
        ///Exceptions:
        ///  System.ArgumentNullException:
        ///    oldPassword is null.-or-newPassword is null.
        ///  System.ArgumentException:
        ///    oldPassword is an empty string.-or-newPassword is an empty string.
        bool ChangePassword(string oldPassword, string newPassword);


        /// <summary>
        /// Updates the password question and answer for the membership user in the membership
        /// data store.
        /// </summary>
        /// <param name="password">The current password for the membership user.</param>
        /// <param name="newPasswordQuestion">The new password question value for the membership user.</param>
        /// <param name="newPasswordAnswer">The new password answer value for the membership user.</param>
        /// <returns><c>true</c> if the update was successful; otherwise, <c>false.</c></returns>
        /// <remarks>
        /// Exceptions:
        ///   System.ArgumentException:
        ///     password is an empty string.-or-newPasswordQuestion is an empty string.-or-newPasswordAnswer
        ///     is an empty string.
        ///
        ///   System.ArgumentNullException:
        ///     password is null.
        /// </remarks>
        bool ChangePasswordQuestionAndAnswer(string password, string newPasswordQuestion, string newPasswordAnswer);


        /// <summary>
        /// Gets the password for the membership user from the membership data store.
        /// </summary>
        /// <returns>The password for the membership user.</returns>
        string GetPassword();


        /// <summary>
        /// Gets the password for the membership user from the membership data store.
        /// </summary>
        /// <param name="passwordAnswer">The password answer for the membership user.</param>
        /// <returns>The password for the membership user.</returns>
        string GetPassword(string passwordAnswer);


        /// <summary>
        /// Resets a user's password to a new, automatically generated password.
        /// </summary>
        /// <returns>The new password for the membership user.</returns>
        string ResetPassword();


        /// <summary>
        /// Resets a user's password to a new, automatically generated password.
        /// </summary>
        /// <param name="passwordAnswer">The password answer for the membership user.</param>
        /// <returns>The new password for the membership user.</returns>
        string ResetPassword(string passwordAnswer);


        /// <summary>
        /// Returns the user name for the membership user.
        /// </summary>
        /// <returns>
        /// The System.Web.Security.MembershipUser.UserName for the membership user.
        /// </returns>
        string ToString();


        /// <summary>
        /// Clears the locked-out state of the user so that the membership user can be validated.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the membership user was successfully unlocked; otherwise, <c>false</c>.
        /// </returns>
        bool UnlockUser();


        /// <summary>
        /// Set when user created 
        /// </summary>
        Guid UserToken { get; set; }

        Guid SessionID { get; set; }


        bool IsReadOnly { get; set; }        


        //
        // Summary:
        //     Creates a new membership user object with the specified property values.
        //
        // Parameters:
        //   isApproved:
        //     The System.Web.Security.MembershipUser.IsApproved value for the membership
        //     user.
        //
        //   lastPasswordChangedDate:
        //     The System.Web.Security.MembershipUser.LastPasswordChangedDateSystem.DateTime
        //     object for the membership user.
        //
        //   lastActivityDate:
        //     The System.Web.Security.MembershipUser.LastActivityDateSystem.DateTime object
        //     for the membership user.
        //
        //   isLockedOut:
        //     true to lock out the membership user; otherwise, false.
        //
        //   name:
        //     The System.Web.Security.MembershipUser.Username string for the membership
        //     user.
        //
        //   creationDate:
        //     The System.Web.Security.MembershipUser.CreationDateSystem.DateTime object
        //     for the membership user.
        //
        //   comment:
        //     The System.Web.Security.MembershipUser.Comment string for the membership
        //     user.
        //
        //   lastLoginDate:
        //     The System.Web.Security.MembershipUser.LastLoginDateSystem.DateTime object
        //     for the membership user.
        //
        //   providerUserKey:
        //     The System.Web.Security.MembershipUser.ProviderUserKey identifier for the
        //     membership user.
        //
        //   passwordQuestion:
        //     The System.Web.Security.MembershipUser.PasswordQuestion string for the membership
        //     user.
        //
        //   lastLockoutDate:
        //     The System.Web.Security.MembershipUser.LastLockoutDateSystem.DateTime object
        //     for the membership user.
        //
        //   providerName:
        //     The System.Web.Security.MembershipUser.ProviderName string for the membership
        //     user.
        //
        //   email:
        //     The System.Web.Security.MembershipUser.Email string for the membership user.
        //
        // Exceptions:
        //   System.ArgumentException:
        //     providerName is null.-or-providerName is not found in the System.Web.Security.Membership.Providers
        //     collection.
        //public MembershipUser(string providerName, string name, object providerUserKey, string email, string passwordQuestion, string comment, bool isApproved, bool isLockedOut, DateTime creationDate, DateTime lastLoginDate, DateTime lastActivityDate, DateTime lastPasswordChangedDate, DateTime lastLockoutDate);

        // Summary:
        //     Gets or sets application-specific information for the membership user.
        //
        // Returns:
        //     Application-specific information for the membership user.
    }
}